<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>XXX安装 - 节点列表</title>

    <!-- Bootstrap core CSS -->
    <link href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
    <link href="//cdn.bootcss.com/bootstrap-table/1.10.1/bootstrap-table.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="style/common.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>

<div class="container">
    <div class="row">
        <div class="col-md-12 col-sm-12">
            <div class="page-header">
                <h1>XXX 安装</h1>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-2 col-sm-3">
            <nav>
                <ul class="nav nav-pills nav-stacked">
                    <li role="presentation"><a href="index.html">1) &nbsp; 安装说明</a></li>
                    <li role="presentation" class="active"><a href="javascript: void(0);">2) &nbsp; 节点列表</a></li>
                    <li role="presentation"><a href="roles.html">3) &nbsp; 角色配置</a></li>
                    <li role="presentation"><a href="settings.html">4) &nbsp; 参数设置</a></li>
                    <li role="presentation"><a href="install-start.html">5) &nbsp; 开始安装</a></li>
                </ul>
            </nav>
        </div>
        <div class="col-md-10 col-sm-9">


            <div class="panel panel-default">
                <div class="panel-heading">
                    <h2 class="panel-title">节点列表</h2>
                </div>
                <div class="panel-body">

                    <form class="form-inline">
                        <div class="form-group">
                            <label class="sr-only" for="hostname">主机名</label>
                            <input type="email" class="form-control" id="hostname" name="hostname" placeholder="主机名">
                        </div>
                        <div class="form-group">
                            <label class="sr-only" for="ip">IP</label>
                            <input type="" class="form-control" id="ip" name="ip" placeholder="IP">
                        </div>
                        <button type="submit" class="btn btn-primary">增加</button>
                    </form><br/>

                    <table id="nodesTable"
                           data-toggle="table"
                           data-url="script/nodes.json">
                        <thead>
                        <tr>
                            <th data-field="hostname">主机名</th>
                            <th data-field="ip">IP</th>
                            <th data-field="services" data-formatter="nodes.servicesFormatter" >服务</th>
                            <th data-formatter="nodes.opFormatter" >操作</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
            <p>
                <a class="btn btn-default" href="index.html">上一步</a>
                <a class="btn btn-primary" href="roles.html">下一步</a>
            </p>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12 col-sm-12">
            <div class="copyright">Copyright © 2010 - 2016 TIZA. All Rights Reserved</div>
        </div>
    </div>
</div>


<!-- Modals -->

<div class="modal fade" id="nodeDelModal" role="dialog" aria-labelledby="gridSystemModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="gridSystemModalLabel">节点删除</h4>
            </div>
            <div class="modal-body">
                <p>您确定删除节点 <strong id="hostnameToDel"></strong> ? </p>
            </div>
            <form id="nodeDelForm">
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

                    <input type="hidden" name="hostname" value="" />
                <button type="button" class="btn btn-primary">确认</button>
            </div>
            </form>
        </div>
    </div>
</div>

<!-- Bootstrap core JavaScript -->
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap-table/1.10.1/bootstrap-table.min.js"></script>
<script src="script/common.js"></script>
<script type="text/javascript">

    $(function() {
        $('#nodeDelModal').on('show.bs.modal', function (event) {
            var button = $(event.relatedTarget);
            var hostname = button.data('hostname');
            var modal = $(this);
            modal.find('#hostnameToDel').text(hostname);
            modal.find('input[name=\'hostname\']').val(hostname);
        });

        $('#nodeDelForm').submit(function() {
            // TODO
        });
    });

</script>
</body>
</html>
